home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Compendium Deluxe 2
/
LSD and 17bit Compendium Deluxe - Volume II.iso
/
a
/
prog
/
asmsrc
/
phagexsources.lha
/
source
/
IFFReader.s
< prev
next >
Wrap
Text File
|
1994-07-10
|
17KB
|
1,029 lines
Opt c-
Section "Base Code",Code_f
MainBase = $58000
CopperList1 = $40000
CopperList2 = $4cf04
Start Movem.l d0-d7/a0-a6,-(sp)
Bsr KillSys
Lea CopperList,a0
Lea HardWare,a6
Move.l a0,Cop1Lc(a6)
Move.w #$83c0,DMACon(a6)
Bsr ConvertIFF
Bsr CopperRotate
Loop Btst #6,$Bfe001
Bne Loop
Bsr ReturnSys
Movem.l (sp)+,d0-d7/a0-a6
Moveq #0,d0
Rts
ConvertIFF Lea IFFPiccy,a1
Move.l (a1)+,d0
Cmp.l #"FORM",d0
Beq FoundIFF
Rts
FoundIFF Move.l (a1)+,d1
NewForm Move.l (a1)+,d0
Cmp.l #"ANIM",d0
Beq GetAnim
Cmp.l #"ILBM",d0
Beq GetAnim
Rts
GetAnim Move.l (a1)+,d0
Move.l (a1)+,d1
Cmp.l #"FORM",d0
Beq NewForm
Cmp.l #"BMHD",d0
Beq GetInfo
Cmp.l #"CMAP",d0
Beq GetPalette
Cmp.l #"BODY",d0
Beq DecrunchIFF
EndHunk Add.l d1,a1
Btst #0,d1
Beq SkipTest
Addq.l #1,a1
SkipTest Lea IFFPiccy,a5
Add.l #EndFile-IFFPiccy,a5
Cmp.l a5,a1
Blt GetAnim
ExitConv Rts
GetInfo Lea PiccyWidth(pc),a5
Move.w 00(a1),00(a5)
Move.w 02(a1),02(a5)
Move.b 08(a1),05(a5)
Bra EndHunk
DecrunchIFF Move.l ScreenBase(pc),a3
Move.l d1,d7
Move.l a1,a2
Move.l a2,a4
Add.l d1,a4
DecLoop Moveq #0,d0
Move.b (a2)+,d0
Bmi GetByte
DataLoop Move.b (a2)+,(a3)+
Dbf d0,DataLoop
Bra CheckLast
GetByte Cmp.b #-128,d0
Beq CheckLast
Neg.b d0
Move.b (a2)+,d2
ByteLoop Move.b d2,(a3)+
Dbf d0,ByteLoop
CheckLast Cmpa.l a2,a4
Bgt DecLoop
Bra EndHunk
GetPalette Move.l a1,a3
Lea Palette(pc),a4
Moveq #0,d2
Moveq #0,d7
Move.w Planes(pc),d2
Bset d2,d7
Moveq #16,d7
Moveq #0,d0
DoColours Move.b (a3)+,d5 ; Red
Move.b (a3)+,d2 ; Green
Move.b (a3)+,d3 ; Blue
Lsr.b #4,d3
Move.b d5,d4
Asl.w #4,d4
Or.b d2,d4
Or.b d3,d4
Move.w d4,(a4)+
Moveq #0,d4
Addq #1,d0
Cmp.b d0,d7
Bne DoColours
Bra EndHunk
CopperRotate Bsr MakeColourData2
Bsr MakeCopper
Lea MainCopper,a0
Move.l a0,$Dff080
MainLoop Bsr VBL
Bsr DoubleBuffer
Bsr DoSines
Bsr MakeRotation
Bsr BuildXYData
Btst #6,$Bfe001
Bne MainLoop
Rts
DoSines Lea CopSine(pc),a0
Lea SineVar1(pc),a5
Lea $200(a0),a0
Move.w SineVar1(pc),d0
Move.w 0(a0,d0.w),d0
Muls #$80,d0
Asr.l #8,d0
Add.w #$A0,d0
Move.w d0,08(a5)
Move.w SineVar2(pc),d0
Move.w 0(a0,d0.w),d0
Muls #$5A,d0
Asr.w #8,d0
Add.w #$80,d0
Move.w d0,10(a5)
Move.w SineVar3(pc),d0
Move.w 0(a0,d0.w),d0
Asr.w #5,d0
Add.w d0,d0
Add.w d0,06(a5)
Add.w #4,00(a5)
Add.w #8,02(a5)
Add.w #6,04(a5)
And.w #$7fe,00(a5)
And.w #$7fe,02(a5)
And.w #$7fe,04(a5)
And.w #$0,06(a5)
Rts
DoubleBuffer Lea CopperListPt1(pc),a0
Move.l (a0),d0
Move.l 4(a0),(a0)
Move.l d0,4(a0)
Lea Copper2Ptr,a0
Move.w d0,6(a0)
Swap d0
Move.w d0,2(a0)
Rts
MakeRotation Lea CopSine(pc),a1
Lea $200(a1),a0
Lea RotSines(pc),a2
Lea RotSineX1(pc),a3
Move.w ZRot(pc),d0
Moveq.l #2,d7
MakeRotSine Move.w 0(a1,d0.w),d1
Move.w 0(a0,d0.w),d2
Muls (a2),d1
Muls 2(a2),d2
Add.l d2,d1
Asr.l #8,d1
Move.w 0(a0,d0.w),d2
Move.w 0(a1,d0.w),d3
Muls (a2),d2
Muls 2(a2),d3
Sub.l d3,d2
Asr.l #8,d2
Add.w XPos(pc),d1
Add.w YPos(pc),d2
Move.w d1,(a3)+
Move.w d2,(a3)+
Addq #4,a2
Dbf d7,MakeRotSine
Rts
BuildXYData Lea MatrixVar1(pc),a6
Move.w RotSineX3(pc),d0
Move.w RotSineX4(pc),d1
Ext.l d0
Ext.l d1
Asl.l #8,d0
Asl.l #8,d1
Move.l d0,00(a6)
Move.l d1,04(a6)
Move.w RotSineX5(pc),d2
Move.w RotSineX6(pc),d3
Ext.l d2
Ext.l d3
Asl.l #8,d2
Asl.l #8,d3
Sub.l d0,d2
Sub.l d1,d3
Divs #$2c,d2
Divs #$2c,d3
Ext.l d2
Ext.l d3
Move.l d2,08(a6)
Move.l d3,16(a6)
Move.w RotSineX1(pc),d2
Move.w RotSineX2(pc),d3
Ext.l d2
Ext.l d3
Asl.l #8,d2
Asl.l #8,d3
Sub.l d0,d2
Sub.l d1,d3
Divs #$48,d2
Divs #$48,d3
Ext.l d2
Ext.l d3
Move.l d2,12(a6)
Move.l d3,20(a6)
Lea SetCopperLine+2(pc),a0
Moveq.l #0,d0
Moveq.l #0,d1
Move.l MatrixVar3(pc),d2
Move.l MatrixVar5(pc),d3
Moveq.l #$2b,d7
AlterMatrixLoop Move.l d0,d4
Asr.l #8,d4
Move.l d1,d5
Asr.l #8,d5
Muls #$280,d5
Add.w d4,d5
Add.w d4,d5
Move.w d5,(a0)
Add.l d2,d0
Add.l d3,d1
Lea $14(a0),a0
Dbf d7,AlterMatrixLoop
Move.l CopperListPt1(pc),a1
Addq #6,a1
Move.l ColourTabBase(pc),a5
Moveq.l #$47,d7
Move.l MatrixVar1(pc),d1
Move.l MatrixVar2(pc),d2
Move.l MatrixVar4(pc),d3
Move.l MatrixVar6(pc),d4
CopperLineLoop Move.l d1,d5
Move.l d2,d6
Asr.l #8,d5
Asr.l #8,d6
Muls #$280,d6
Add.l d5,d6
Add.l d5,d6
Move.l a5,a0
Add.l d6,a0
Bsr SetCopperLine
Add.l d3,d1
Add.l d4,d2
Lea $230(a1),a1
Dbf d7,CopperLineLoop
Rts
SetCopperLine Move.w $400(a0),d0
Move.w d0,(a1)
Move.w d0,$0b8(a1)
Move.w d0,$170(a1)
Move.w d0,$228(a1)
Addq.l #4,a1
Move.w $400(a0),d0
Move.w d0,(a1)
Move.w d0,$0b8(a1)
Move.w d0,$170(a1)
Move.w d0,$228(a1)
Addq.l #4,a1
Move.w $400(a0),d0
Move.w d0,(a1)
Move.w d0,$0b8(a1)
Move.w d0,$170(a1)
Move.w d0,$228(a1)
Addq.l #4,a1
Move.w $400(a0),d0
Move.w d0,(a1)
Move.w d0,$0b8(a1)
Move.w d0,$170(a1)
Move.w d0,$228(a1)
Addq.l #4,a1
Move.w $400(a0),d0
Move.w d0,(a1)
Move.w d0,$0b8(a1)
Move.w d0,$170(a1)
Move.w d0,$228(a1)
Addq.l #4,a1
Move.w $400(a0),d0
Move.w d0,(a1)
Move.w d0,$0b8(a1)
Move.w d0,$170(a1)
Move.w d0,$228(a1)
Addq.l #4,a1
Move.w $400(a0),d0
Move.w d0,(a1)
Move.w d0,$0b8(a1)
Move.w d0,$170(a1)
Move.w d0,$228(a1)
Addq.l #4,a1
Move.w $400(a0),d0
Move.w d0,(a1)
Move.w d0,$0b8(a1)
Move.w d0,$170(a1)
Move.w d0,$228(a1)
Addq.l #4,a1
Move.w $400(a0),d0
Move.w d0,(a1)
Move.w d0,$0b8(a1)
Move.w d0,$170(a1)
Move.w d0,$228(a1)
Addq.l #4,a1
Move.w $400(a0),d0
Move.w d0,(a1)
Move.w d0,$0b8(a1)
Move.w d0,$170(a1)
Move.w d0,$228(a1)
Addq.l #4,a1
Move.w $400(a0),d0
Move.w d0,(a1)
Move.w d0,$0b8(a1)
Move.w d0,$170(a1)
Move.w d0,$228(a1)
Addq.l #4,a1
Move.w $400(a0),d0
Move.w d0,(a1)
Move.w d0,$0b8(a1)
Move.w d0,$170(a1)
Move.w d0,$228(a1)
Addq.l #4,a1
Move.w $400(a0),d0
Move.w d0,(a1)
Move.w d0,$0b8(a1)
Move.w d0,$170(a1)
Move.w d0,$228(a1)
Addq.l #4,a1
Move.w $400(a0),d0
Move.w d0,(a1)
Move.w d0,$0b8(a1)
Move.w d0,$170(a1)
Move.w d0,$228(a1)
Addq.l #4,a1
Move.w $400(a0),d0
Move.w d0,(a1)
Move.w d0,$0b8(a1)
Move.w d0,$170(a1)
Move.w d0,$228(a1)
Addq.l #4,a1
Move.w $400(a0),d0
Move.w d0,(a1)
Move.w d0,$0b8(a1)
Move.w d0,$170(a1)
Move.w d0,$228(a1)
Addq.l #4,a1
Move.w $400(a0),d0
Move.w d0,(a1)
Move.w d0,$0b8(a1)
Move.w d0,$170(a1)
Move.w d0,$228(a1)
Addq.l #4,a1
Move.w $400(a0),d0
Move.w d0,(a1)
Move.w d0,$0b8(a1)
Move.w d0,$170(a1)
Move.w d0,$228(a1)
Addq.l #4,a1
Move.w $400(a0),d0
Move.w d0,(a1)
Move.w d0,$0b8(a1)
Move.w d0,$170(a1)
Move.w d0,$228(a1)
Addq.l #4,a1
Move.w $400(a0),d0
Move.w d0,(a1)
Move.w d0,$0b8(a1)
Move.w d0,$170(a1)
Move.w d0,$228(a1)
Addq.l #4,a1
Move.w $400(a0),d0
Move.w d0,(a1)
Move.w d0,$0b8(a1)
Move.w d0,$170(a1)
Move.w d0,$228(a1)
Addq.l #4,a1
Move.w $400(a0),d0
Move.w d0,(a1)
Move.w d0,$0b8(a1)
Move.w d0,$170(a1)
Move.w d0,$228(a1)
Addq.l #4,a1
Move.w $400(a0),d0
Move.w d0,(a1)
Move.w d0,$0b8(a1)
Move.w d0,$170(a1)
Move.w d0,$228(a1)
Addq.l #4,a1
Move.w $400(a0),d0
Move.w d0,(a1)
Move.w d0,$0b8(a1)
Move.w d0,$170(a1)
Move.w d0,$228(a1)
Addq.l #4,a1
Move.w $400(a0),d0
Move.w d0,(a1)
Move.w d0,$0b8(a1)
Move.w d0,$170(a1)
Move.w d0,$228(a1)
Addq.l #4,a1
Move.w $400(a0),d0
Move.w d0,(a1)
Move.w d0,$0b8(a1)
Move.w d0,$170(a1)
Move.w d0,$228(a1)
Addq.l #4,a1
Move.w $400(a0),d0
Move.w d0,(a1)
Move.w d0,$0b8(a1)
Move.w d0,$170(a1)
Move.w d0,$228(a1)
Addq.l #4,a1
Move.w $400(a0),d0
Move.w d0,(a1)
Move.w d0,$0b8(a1)
Move.w d0,$170(a1)
Move.w d0,$228(a1)
Addq.l #4,a1
Move.w $400(a0),d0
Move.w d0,(a1)
Move.w d0,$0b8(a1)
Move.w d0,$170(a1)
Move.w d0,$228(a1)
Addq.l #4,a1
Move.w $400(a0),d0
Move.w d0,(a1)
Move.w d0,$0b8(a1)
Move.w d0,$170(a1)
Move.w d0,$228(a1)
Addq.l #4,a1
Move.w $400(a0),d0
Move.w d0,(a1)
Move.w d0,$0b8(a1)
Move.w d0,$170(a1)
Move.w d0,$228(a1)
Addq.l #4,a1
Move.w $400(a0),d0
Move.w d0,(a1)
Move.w d0,$0b8(a1)
Move.w d0,$170(a1)
Move.w d0,$228(a1)
Addq.l #4,a1
Move.w $400(a0),d0
Move.w d0,(a1)
Move.w d0,$0b8(a1)
Move.w d0,$170(a1)
Move.w d0,$228(a1)
Addq.l #4,a1
Move.w $400(a0),d0
Move.w d0,(a1)
Move.w d0,$0b8(a1)
Move.w d0,$170(a1)
Move.w d0,$228(a1)
Addq.l #4,a1
Move.w $400(a0),d0
Move.w d0,(a1)
Move.w d0,$0b8(a1)
Move.w d0,$170(a1)
Move.w d0,$228(a1)
Addq.l #4,a1
Move.w $400(a0),d0
Move.w d0,(a1)
Move.w d0,$0b8(a1)
Move.w d0,$170(a1)
Move.w d0,$228(a1)
Addq.l #4,a1
Move.w $400(a0),d0
Move.w d0,(a1)
Move.w d0,$0b8(a1)
Move.w d0,$170(a1)
Move.w d0,$228(a1)
Addq.l #4,a1
Move.w $400(a0),d0
Move.w d0,(a1)
Move.w d0,$0b8(a1)
Move.w d0,$170(a1)
Move.w d0,$228(a1)
Addq.l #4,a1
Move.w $400(a0),d0
Move.w d0,(a1)
Move.w d0,$0b8(a1)
Move.w d0,$170(a1)
Move.w d0,$228(a1)
Addq.l #4,a1
Move.w $400(a0),d0
Move.w d0,(a1)
Move.w d0,$0b8(a1)
Move.w d0,$170(a1)
Move.w d0,$228(a1)
Addq.l #4,a1
Move.w $400(a0),d0
Move.w d0,(a1)
Move.w d0,$0b8(a1)
Move.w d0,$170(a1)
Move.w d0,$228(a1)
Addq.l #4,a1
Move.w $400(a0),d0
Move.w d0,(a1)
Move.w d0,$0b8(a1)
Move.w d0,$170(a1)
Move.w d0,$228(a1)
Addq.l #4,a1
Move.w $400(a0),d0
Move.w d0,(a1)
Move.w d0,$0b8(a1)
Move.w d0,$170(a1)
Move.w d0,$228(a1)
Addq.l #4,a1
Move.w $400(a0),d0
Move.w d0,(a1)
Move.w d0,$0b8(a1)
Move.w d0,$170(a1)
Move.w d0,$228(a1)
Addq.l #4,a1
Rts
MakeColourData Move.l ColourTabBase(pc),a0
Lea Palette(pc),a1
Move.l PiccyBase(pc),a2
Lea $2800(a2),a3
Lea $2800(a3),a4
Lea $2800(a4),a5
Lea $2800(a5),a6
Move.w #255,d7
MakeVertLoop Move.w #319,d6
Move.b #$80,d5
Moveq.l #7,d4
MakeHorizLoop Move.b (a6),d0
And.b d5,d0
Ror.b d4,d0
Move.b (a5),d1
And.b d5,d1
Ror.b d4,d1
Add.b d0,d0
Or.b d1,d0
Move.b (a4),d1
And.b d5,d1
Ror.b d4,d1
Add.b d0,d0
Or.b d1,d0
Move.b (a3),d1
And.b d5,d1
Ror.b d4,d1
Add.b d0,d0
Or.b d1,d0
Move.b (a2),d1
And.b d5,d1
Ror.b d4,d1
Add.b d0,d0
Or.b d1,d0
And.w #31,d0
Add.w d0,d0
Move.w 0(a1,d0.w),(a0)+
Ror.b #1,d5
Bpl SkipAdd
Addq #1,a2
Addq #1,a3
Addq #1,a4
Addq #1,a5
Addq #1,a6
SkipAdd Subq.b #1,d4
And.b #7,d4
Dbf d6,MakeHorizLoop
Dbf d7,MakeVertLoop
Rts
MakeColourData2 Move.l ScreenBase(pc),a3
Lea Palette(pc),a1
Move.l ColourTabBase(pc),a2
Move.l #255,d6
GetLine Move.l a3,a0
Moveq #0,d4 ; Colour reg
Moveq #39,d5
GetNewByte Moveq #7,d1
GetPixel Moveq #0,d3
Moveq #0,d2
Move.b $00(a0),d0
Bsr CheckBit
Addq #1,d3
Move.b $28(a0),d0
Bsr CheckBit
Addq #1,d3
Move.b $50(a0),d0
Bsr CheckBit
Addq #1,d3
Move.b $78(a0),d0
Bsr CheckBit
Addq #1,d3
Move.b $a0(a0),d0
Bsr CheckBit
Addq #1,d3
Move.b $c8(a0),d0
Bsr CheckBit
Move.l d2,a4
Asr.w #4,d2
And.w #3,d2
Cmpi.w #0,d2
Beq NewBaseCol
Cmpi.w #1,d2
Beq ChangeBlue
Cmpi.w #2,d2
Beq ChangeRed
Cmpi.w #3,d2
Beq ChangeGreen
NewBaseCol Move.l a4,d0
And.l #$f,d0
Add.w d0,d0
Move.w (a1,d0),d4
Bra DoPixel
ChangeBlue Move.l a4,d0
And.w #$f,d0
And.w #$ff0,d4
Or.w d0,d4
Bra DoPixel
ChangeRed Move.l a4,d0
And.w #$f,d0
Asl.w #8,d0
And.w #$0ff,d4
Or.w d0,d4
Bra DoPixel
ChangeGreen Move.l a4,d0
And.w #$f,d0
Asl.w #4,d0
And.w #$f0f,d4
Or.w d0,d4
Bra DoPixel
DoPixel Move.w d4,(a2)+
Subq #1,d1
Cmpi.w #-1,d1
Bne GetPixel
Addq #1,a0
Dbf d5,GetNewByte
Add.l #$f0,a3
Dbf d6,GetLine
Rts
CheckBit Btst d1,d0
Beq DoneBit
Bset d3,d2
DoneBit Rts
MakeCopper Move.l CopperListPt1(pc),a0
Move.l CopperListPt2(pc),a1
Move.w #$37,d1
Move.w #$37,d2
Move.l #287,d7
Move.b #$1c,d0
MakeCopLoop1 Move.b d0,(a0)+
Move.b d0,(a1)+
Move.b d1,(a0)+
Move.b d1,(a1)+
Move.w #$fffe,(a0)+
Move.w #$fffe,(a1)+
Move.l #44,d6
MakeCopLoop2 Move.l #$01800000,(a0)+
Move.l #$01800000,(a1)+
Dbf d6,MakeCopLoop2
Addq.w #1,d0
Exg d1,d2
Dbf d7,MakeCopLoop1
Move.l #$fffffffe,(a0)+
Move.l #$fffffffe,(a1)+
Rts
MakeColourData1 Move.l ColourTabBase(pc),a0
Moveq #0,d0
Move.l #255,d7
MakeVertLoop1 Move.l #319,d6
MakeHorizLoop1 Addq #1,d1
Move.w d1,d2
Asl.w #8,d2
And.w #$f00,d2
Or.w d0,d2
Move.w d2,(a0)+
Dbf d6,MakeHorizLoop1
Addq #1,d0
Moveq #0,d1
Dbf d7,MakeVertLoop1
Rts
SineVar1 Dc.w 0
SineVar2 Dc.w 0
SineVar3 Dc.w 0
ZRot Dc.w 0
XPos Dc.w $00A0
YPos Dc.w $0028
RotSines Dc.w $FFE6
Dc.w $FFEC
Dc.w $FFE6
Dc.w $0014
Dc.w $001A
Dc.w $0014
RotSineX1 Dc.w 0
RotSineX2 Dc.w 0
RotSineX3 Dc.w 0
RotSineX4 Dc.w 0
RotSineX5 Dc.w 0
RotSineX6 Dc.w 0
MatrixVar1 Dc.l 0
MatrixVar2 Dc.l 0
MatrixVar3 Dc.l 0
MatrixVar4 Dc.l 0
MatrixVar5 Dc.l 0
MatrixVar6 Dc.l 0
Palette Dc.w $000,$000,$111,$111,$222,$222,$333,$333
Dc.w $444,$444,$555,$555,$666,$666,$777,$777
Dc.w $888,$888,$999,$999,$aaa,$aaa,$bbb,$bbb
Dc.w $ccc,$ccc,$ddd,$ddd,$eee,$eee,$fff,$fff
PiccyBase Dc.l $a0000
ColourTabBase Dc.l MainBase
CopperListPt1 Dc.l CopperList1
CopperListPt2 Dc.l CopperList2
CopSine Incbin Work:Programming/lsdcode/SysData/CopRot.Sine
WaitBlitter Btst #$6,$2(a6)
Bne WaitBlitter
Rts
VBL Move.l $Dff004,d0
And.l #$1ff00,d0
Cmp.l #$13000,d0
Bne VBL
Rts
KillSys Bsr.s SysWait
Move.l $4,a6
Lea GFXName(pc),a1
Moveq #0,d0
Jsr -552(a6)
Lea OldCop1(pc),a5
Move.l $26(a0),$0(a5)
Move.l $32(a0),$4(a5)
Lea HardWare,a6
Move.w IntEnaR(a6),d0
Move.w DMAConR(a6),d1
Or.w #$8000,d0
And.w #$03ff,d1
Or.w #$8000,d1
Move.w d0,$8(a5)
Move.w d1,$a(a5)
Move.w #$7fff,IntEna(a6)
Move.w #$7fff,DMACon(a6)
Rts
SysWait Move.w #15,d7
SysWaitLoop Move.l #$05000,d1
Bsr.s WaitVBL
Bsr.s DoWaitVBL
Dbf d7,SysWaitLoop
Rts
DoWaitVBL Move.l #$03000,d1
WaitVBL Movem.l d0-d1/a6,-(sp)
Lea HardWare,a6
WaitVBLLoop Move.l VPosR(a6),d0
And.l #$1ff00,d0
Cmp.l d1,d0
Bne.s WaitVBLLoop
Movem.l (sp)+,d0-d1/a6
Rts
ReturnSys Lea HardWare,a6
Move.w OldIntEna(pc),IntEna(a6)
Move.w OldDMACon(pc),DMACon(a6)
Move.l OldCop1(pc),Cop1lc(a6)
Move.l OldCop2(pc),Cop2lc(a6)
Rts
GFXName Dc.b "graphics.library",0
Even
OldCop1 Dc.l 0
OldCop2 Dc.l 0
OldIntEna Dc.w 0
OldDmaCon Dc.w 0
ScreenBase Dc.l $40000
PiccyWidth Dc.w 0
PiccyHeight Dc.w 0
Planes Dc.w 0
Cmv Macro
Dc.w \2,\1
EndM
Cwt Macro
Dc.w (\1*$100)+$01,$fffe
EndM
Pal Macro
Dc.w $ffe1,$fffe
EndM
EndCop Macro
Dc.w $ffff,$fffe
EndM
Section "ChipStuff",Code_c
MainCopper Dc.l $008E1C71
Dc.l $00903CD1
Dc.l $00920028
Dc.l $009400D0
Dc.l $01000200
Dc.l $01820000
Dc.l $01080000
Dc.l $010A0000
Copper2Ptr Dc.l $00840000
Dc.l $00860000
Dc.l $008AFFFF
CopperList Cwt $15
Cmv $0200,BplCon0
Cmv $00bb,BplCon1
Cmv $000a,BplCon2
Cmv $0034,DdfStrt
Cmv $00c8,DdfStop
Cmv $1681,DiwStrt
Cmv $36c1,DiwStop
Cmv $c8,BplMod1
Cmv $c8,BplMod2
Cwt $25
Cmv $0000,Color00
Cmv $0111,Color01
Cmv $0222,Color02
Cmv $0333,Color03
Cmv $0444,Color04
Cmv $0555,Color05
Cmv $0666,Color06
Cmv $0777,Color07
Cmv $0888,Color08
Cmv $0999,Color09
Cmv $0aaa,Color10
Cmv $0bbb,Color11
Cmv $0ccc,Color12
Cmv $0ddd,Color13
Cmv $0eee,Color14
Cmv $0fff,Color15
CopperBPLS Cmv $4,BplPt0h
Cmv $0,BplPt0l
Cmv $4,BplPt1h
Cmv $28,BplPt1l
Cmv $4,BplPt2h
Cmv $50,BplPt2l
Cmv $4,BplPt3h
Cmv $78,BplPt3l
Cmv $4,BplPt4h
Cmv $a0,BplPt4l
Cmv $4,BplPt5h
Cmv $c8,BplPt5l
Cwt $28
Cmv $6a00,BplCon0
EndCop
IFFPiccy Incbin ram:Piccy
EndFile
****Custom Chip Registers****
Hardware = $Dff000
;Control Registers
Dmaconr = $002
Vposr = $004
Vhposr = $006
Joy0dat = $00A
Joy1dat = $00C
Clxdat = $00E
Intenar = $01C
Intereqr = $01E
Copcon = $02E
;Blitter Registers
Bltcon0 = $040
Bltcon1 = $042
Bltafwm = $044
Bltalwm = $046
Bltcpth = $048
Bltcptl = $04A
Bltbpth = $04C
Bltbptl = $04E
Bltapth = $050
Bltaptl = $052
Bltdpth = $054
Bltdptl = $056
Bltsize = $058
Bltcmod = $060
Bltbmod = $062
Bltamod = $064
Bltdmod = $066
Bltcdat = $070
Bltbdat = $072
Bltadat = $074
;Copper Registers
Cop1lc = $080
Cop1lch = $080
Cop1lcl = $082
Cop2lc = $084
Cop2lch = $084
Cop2lcl = $086
Copjmp1 = $088
Copjmp2 = $08A
Diwstrt = $08E
Diwstop = $090
Ddfstrt = $092
Ddfstop = $094
Dmacon = $096
Clxcon = $098
Intena = $09A
Intreq = $09C
;BitPlane Registers
BplCon0 = $100
BplCon1 = $102
BplCon2 = $104
BplMod1 = $108
BplMod2 = $10a
BplPt0h = $0e0
BplPt0l = $0e2
BplPt1h = $0e4
BplPt1l = $0e6
BplPt2h = $0e8
BplPt2l = $0ea
BplPt3h = $0ec
BplPt3l = $0ee
BplPt4h = $0f0
BplPt4l = $0f2
BplPt5h = $0f4
BplPt5l = $0f6
;Colour Registers
Color00 = $180
Color01 = $182
Color02 = $184
Color03 = $186
Color04 = $188
Color05 = $18a
Color06 = $18c
Color07 = $18e
Color08 = $190
Color09 = $192
Color10 = $194
Color11 = $196
Color12 = $198
Color13 = $19a
Color14 = $19c
Color15 = $19e
Color16 = $1a0
Color17 = $1a2
Color18 = $1a4
Color19 = $1a6
Color20 = $1a8
Color21 = $1aa
Color22 = $1ac
Color23 = $1ae
Color24 = $1b0
Color25 = $1b2
Color26 = $1b4
Color27 = $1b6
Color28 = $1b8
Color29 = $1ba
Color30 = $1bc
Color31 = $1be
EcsNop = $1fe